package com.kfm.base.io.b;

import java.io.BufferedOutputStream;
import java.io.IOException;

public class Demo10 {


    public static void main(String[] args) {
//        byte[] bytes = "abcd".getBytes();
//        ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
//
//        int read = bis.read();
//
//        System.out.println(read);
//
//        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
//
//        byteArrayOutputStream.write(1);
//        byteArrayOutputStream.write(2);
//        byteArrayOutputStream.write(3);
//
//
//        byte[] byteArray = byteArrayOutputStream.toByteArray();
//        System.out.println(Arrays.toString(byteArray));

//        BufferedInputStream bis = new BufferedInputStream(System.in);
//
//        try {
//            int read = bis.read();
//            System.out.println(read);
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }


        BufferedOutputStream bos = new BufferedOutputStream(System.out);

        try {
            bos.write(1);
            bos.write(2);
            bos.write(3);

            bos.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
